<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../script/pivot.js"></script>
<script type="text/javascript" src="../script/crosstab.js"></script>
<meta name="author" content="CarlHuang">
<title>客户积分查询</title>
<script language="javascript" src="../script/common.js"
	type="text/javascript"></script>
<script language="javascript" type="text/javascript"> 	
		var qt={};
		var qt2={};
     function load(){
	   Eui.showNavigation();
         Common.initDict(searchForm.idnoType1,"idno_type","全 部");
         Common.initDict(searchForm.idnoType2,"idno_type","全 部");
         Common.initDict(searchForm.carduser,"carduser_customer");
         $("searchForm").reset();
         if($("searchForm").carduser.value=="1") { 
	 $("customer").style.display="";
	 $("orgcustomer").style.display="none";
	 }
	if($("searchForm").carduser.value=="2"){

	 $("customer").style.display="none";
	 $("orgcustomer").style.display="";
	}
	   setPages(["listView"]);
	 }
	   function showData1(){
	      if($("searchForm").carduser.value=="1")
	      { 
	       createTable1();
	       qt.showTable();
	        $("datalist").style.display="";
	      }
	      else{
	      createTable2();
	      qt2.showTable();
	       $("datalist").style.display="";
	      }
	    
    }
    function lookback(){
	     switchPage("listView");  
    }
     
	 function createTable1(){   
	 var columns =[];
	 columns[0]= {type:"radio"};
	   qt = new QueryTable("loy_customer_query5","searchForm","datalist",columns
				);
	}	
	function createTable2(){
    var columns =[];
    columns[0]= {type:"radio"};
    qt2 = new QueryTable("loy_orgcustomer_query5","searchForm","datalist",columns
				);
	}	
	function check(){
	   Eui.showNavigation();
         Common.initDict(searchForm.idnoType,"idno_type","全 部");
         if($("searchForm").carduser.value=="1") { 
	 $("customer").style.display="";
	 $("orgcustomer").style.display="none";
	  $("datalist").style.display="none";
	 }
	if($("searchForm").carduser.value=="2"){
	 $("customer").style.display="none";
	 $("orgcustomer").style.display="";
	  $("datalist").style.display="none";
	}
	   setPages(["listView"]);
	}
		function onSave(){
		
		 if(($("searchForm").carduser.value=="1")&&($("datalist").style.display=="none"))  {
		 showWarning("请选择角色！");
		 return;
		 } ;
		  if(($("searchForm").carduser.value=="2")&&($("datalist").style.display="none"))  {
		  showWarning("请选择角色！");
		  return;
		  }  
		   if($("searchForm").carduser.value=="1"&&($("datalist").style.display==""))  onSave1();
		 if($("searchForm").carduser.value=="2"&&($("datalist").style.display==""))  onSave2();
		
		}
	function onSave1() {
			var obj1= qt.getRadioValue(true);
			if (!obj1){
				showWarning("请选择角色！");return;
				qt.showTable();		
			}
			dialogBackValue(obj1);
		}
	function onSave2() {
			var obj2= qt2.getRadioValue(true);
			if (!obj2){
				showWarning("请选择角色！");return;
				qt2.showTable();
			}
			dialogBackValue(obj2);
		}

			
		</script>
</head>
<body onload="load()">
<div class="nav">
<div id="nav">&nbsp;</div>
</div>
<div id="listView">
<div class="searchForm">
<form id='searchForm' name='searchForm'>
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
	<tr>
		<td><label>客户类型</label>&nbsp;&nbsp;<select
			name="carduser" id="carduser" onchange="check();"></select> <span class='des'>*</span>
		</td>
	</tr>	
	  <tr  id="customer" style="display:none">
		<td><label>客户姓名&nbsp;&nbsp;</label><input type="text" name="cardUserName">
		</td>
		<td><label>证件类型</label>&nbsp;&nbsp;&nbsp;&nbsp; <select
			name="idnoType1" onchange="checkV(searchForm.idno1,this.value)"></select></td>
		<td><label>证 件 号</label>&nbsp;&nbsp;&nbsp;&nbsp; <input
			type="text" name="idno1"
			onblur="checkV(this,searchForm.idnoType1.value)"></td>
		
	</tr>
	<tr  id="orgcustomer" style="display:none" >
	    <td><label>单位名称</label> <input type="text" name="orgName">
		</td>
		<td><label>证件类型</label>&nbsp;&nbsp;&nbsp;&nbsp; <select
			name="idnoType2" onchange="checkV(searchForm.idno2,this.value)"></select></td>
		<td><label>证 件 号</label>&nbsp;&nbsp;&nbsp;&nbsp; <input
			type="text" name="idno2"
			onblur="checkV(this,searchForm.idnoType2.value)"></td>
	</tr>
		<tr>
		<td>
		<button type="button" onclick="showData1()">查 询</button>
		</td>
        </tr>
</table>
</form>
</div>
<div id="datalist"  style="display:none"></div>
</div>

</body>
</html>
